<template>
  <h1>1.组件的基本写法</h1>
  <h2>count:{{ count }}--a:{{ a }}</h2>
  <button @click="changeCount">改变count</button>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  name: "About",
  // 在 setup() 函数中返回的对象会暴露给模板和组件实例
  setup() {
    let count = 0;
    const changeCount = () => {
      console.log("事件触发了");
      count++;
    };

    return {
      count,
      changeCount,
      a: 1,
    };
  },
});
</script>

<style scoped></style>
